package day6.Exer;

import java.time.Month;
import java.util.Calendar;
import java.util.Scanner;

public class Exer5 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        System.out.println("请输入年份");
        int year=in.nextInt();
        Calendar a=Calendar.getInstance();
        a.set(year,5-1,31);
        int count=0;
        for(int i=0;i<30;i++){
            a.add(Calendar.DAY_OF_MONTH,1);
            if(a.get(Calendar.DAY_OF_WEEK)==4){
                count++;
                if(count==3){
                    System.out.println(year+"年的父亲节是"+(a.get(Calendar.MONTH)+1)+"月"+a.get(Calendar.DATE)+"日");
                }
            }
        }
    }
}
